﻿using System;
using System.ComponentModel;
using System.Xml.Serialization;
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;
using DevExpress.Xpo.Helpers;
using DevExpress.Data.Filtering;
using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
namespace Top.Module.Domain
{
    [DefaultClassOptions]
    [Persistent("TopDiscount")]
    public class Discount : BaseObject
    {
        //begin
        public Discount()
        {}
        public Discount(Session session) : base(session)
        {}
        public override void AfterConstruction(){base.AfterConstruction();}

        private string _DiscountId;
        public string DiscountId
        {
            get
            {
                return _DiscountId;
            }
            set
            {
                SetPropertyValue("DiscountId", ref _DiscountId, value);
            }
        }
        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                SetPropertyValue("Name", ref _Name, value);
            }
        }
        [Association("DiscountDetails", typeof(DiscountDetail)), Aggregated]
        public XPCollection<DiscountDetail> Details
        {
            get
            {
                return GetCollection<DiscountDetail>("Details");
            }
        }
        private DateTime _Created;
        public DateTime Created
        {
            get
            {
                return _Created;
            }
            set
            {
                SetPropertyValue("Created", ref _Created, value);
            }
        }
        private DateTime _Modified;
        public DateTime Modified
        {
            get
            {
                return _Modified;
            }
            set
            {
                SetPropertyValue("Modified", ref _Modified, value);
            }
        }
        //end
    }
}
